import { createEmptyCard, FSRS } from 'ts-fsrs';

// 创建一个简单的测试函数
async function testFSRS() {
  try {
    // 创建FSRS实例
    const f = new FSRS();
    console.log('FSRS instance created:', f);

    // 创建空卡片
    const card = createEmptyCard();
    console.log('Empty card created:', card);
    console.log('Card properties:', Object.keys(card));

    // 尝试设置state属性
    card.state = 0;
    console.log('Card after setting state:', card);

    // 设置当前时间
    const currentTime = new Date();

    // 尝试使用repeat方法
    const result = f.repeat(card, currentTime, 3); // 3表示Good难度
    console.log('FSRS repeat result:', result);
    console.log('Result properties:', Object.keys(result));
  } catch (error) {
    console.error('Error in FSRS test:', error);
  }
}

// 运行测试
console.log('Running FSRS test...');
testFSRS().catch(err => console.error('Test failed:', err));